


************************************************************
** The following summarizes all of the key steps to
** replicate the CTrip-pollution paper
************************************************************



** To reproduce the paper, change the Stata working directory
** to the `do` directory and type `do summary.do`

************************************************************
**   Clean secondary datasets
************************************************************

** Purpose: Prepare the raw time-card data for study
** Requires: Raw time-card data
** Creates: reshaped-time-stamps.dta 

do clean-time-card-data.do

** Purpose: Pull control variables that BLRY has in their data
** Requires: The BLRY QJE replication data
** Creates: blry-time-invariant-controls.dta 

do pull-blry-controls.do

** Purpose: Put together the weather and pollution data.
** Requires: Scattered pollution and weather data
** Creates: all-our-environmental-data.dta

do compile-all-environmental-data.do

** Purpose: Impute and compare the pollution numbers we have
** Requires: all-our-environmental-data.dta
** Creates: imputed-pollution-measures.dta

do create-imputed-pollution-measures.do

************************************************************
**   Construct main, daily data
************************************************************

** Purpose: Convert CTRIP Excel files to Stata 
** Requires: Raw CTRIP Excel files, after translation
** Creates: ctripFLT.dta & ctripHTL.dta

do import-excel-files.do

** Purpose: Put together everything we need for the day-level analysis
** Requires: ctripFLT.dta & ctripHTL.dta & environmental data
** Creates: ctrip-cleaned-daily-records.dta

do construct-daily-dataset.do

************************************************************
**   Main pollution analysis
************************************************************

** Purpose: Perform daily pollution analysis 
** Requires: ctrip-cleaned-daily-records.dta
** Creates: 0

do study-pollution-in-daily-data.do

** Other, companion programs

do run-quantile-regressions.do
do graph-non-linear-effects.do
